package com.cykj.mapper;

import com.cykj.bean.Goods;
import com.cykj.bean.PageConfig;
import com.cykj.bean.Tbluser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface UserMapper {

    List<Tbluser> selectUserList();

    //登录
    public Tbluser login(@Param(value = "uname") String uname,
                         @Param(value = "upwd") String upwd);

    //注册
    public int regiest(Tbluser tbluser);


    //插入日志
    public int addLog(@Param(value = "module") String module,
                      @Param(value = "action") String action,
                      @Param(value = "remark") String remark);

    // 查询一共有多少
    public  int selectCount();

    //分页查询
    public List<Tbluser> selectUserList2(RowBounds rowBounds);


    //假删除,（修改状态）
    public int deleteUpdate(@Param(value = "uid") String uid);


    //修改信息
    public int updateInfo(@Param(value = "uname") String uname,
                          @Param(value = "idCard") String idCard,
                          @Param(value = "address") String address,
                          @Param(value = "uid") String uid);


    // 查询商品一共有多少
    public  int selectGoodsCount();

    //商品分页查询
    public List<Tbluser> selectGoodsList(RowBounds rowBounds);

    // 查询商品一共有多少 + 商品分页查询
    public Map<String,Object> goodsTables(PageConfig pageConfig);

    //删除商品,（修改状态）
    public int deleteGoods(@Param(value = "id") String id);

    //修改商品
    public int updateGoods(Goods goods);
}


